<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>线下课程报名列表</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="/resources/css/base.css" rel="stylesheet"
	type="text/css" />
<link href="/resources/js/miniui/themes/default/miniui.css"
	rel="stylesheet" type="text/css" />
<script src="/resources/js/jquery-1.6.2.min.js"
	type="text/javascript"></script>
<script src="/resources/js/miniui/miniui.js"
	type="text/javascript"></script>
<script src="/resources/js/ckeditor/ckeditor.js"
	type="text/javascript"></script>
<style type="text/css">
.errorText {
	color: red;
}
#editWindow {top: 50px !important;left:250px!important}
.mini-checkboxlist-item{    float: left;}

.td1 {
	width: 20%;
	text-align: right;
}

.td2 {
	width: 30%;
	text-align: left;
}

.td3 {
	width: 12%;
	text-align: right;
}

.td4 {
	width: 38%;
	text-align: left;
}
</style>
</head>
<body>
	<h1>线下课程报名列表</h1>
	<div style="padding-top: 5px; padding-bottom: 5px; width: 95%;">
		<!-- <a class="mini-button"
			img="/resources/js/miniui/themes/icons/edit.gif"
			onclick="editRow()">修改</a>  -->
		<a class="mini-button"
			img="/resources/js/miniui/themes/icons/remove.gif"
			onclick="delRow()">删除</a> 	
	</div>
	<div id="mini-datagrid" class="mini-datagrid"
		style="width: 95%; height: 400px;"
		url="/offline/apply/selectByPage" pageSize="20" idField="id"
		allowResize="true">

		<div property="columns">
			<div type="indexcolumn">序号</div>
			<div type="checkcolumn">选择</div>
			<div field="course_id">课程id</div>
			<div field="realname">姓名</div>
			<div field="id_no">身份证号码</div>
			<div field="company">工作单位/学校</div>
			<div field="phone">联系方式</div>
			<div field="create_time">报名时间</div>
		</div>
	</div>


	

</body>
<script type="text/javascript">
	mini.parse();
	var datagrid = mini.get("mini-datagrid");
	var editWindow = mini.get("editWindow");
	
	var form = new mini.Form("editform");
	
	datagrid.load();
	
	function delRow() {

		var node = datagrid.getSelected();
		if (node) {
			mini.confirm("确定删除！", "提示", function(retCode) {
				console.log(retCode);
				if (retCode == 'ok') {
					
					$.ajax({
						url : "/offline/apply/delete",
						data : {
							id : node.id
						},
						type : "post",
						dataType : "json",
						success : function() {
							editWindow.hide();
							datagrid.reload();
						},
						error : function(jqXHR, textStatus, errorThrown) {
							alert(jqXHR.responseText);
						}
					});

				}
			})
		} else {
			mini.alert("请选择一条!");
		}
	}	
</script>

</html>
